$(document).ready(function(){
$("textarea[maxlength]").keyup(function(){
var limit = parseInt($(this).attr('maxlength'));
var text = $(this).val();
var chars = text.length;
$(".count").text(parseInt(limit-chars)+' characters remaining').css('color','#000000');
if(chars >= limit)
{
$(".count").text('0 Characters Remaining').css('color','#FF0000');
var new_text = text.substr(0, limit);
$(this).val(new_text);
}
});
});